﻿using RedmineTypes = Redmine.Net.Api.Types;

namespace Redmine.Laptop.API.Models
{
    public class UserGroup
    {
        public int UserGroupID { get; set; }
        public string UserGroupName { get; set; }

        public static explicit operator RedmineTypes::UserGroup(UserGroup userGroup)
        {
            return new RedmineTypes::UserGroup
                       {
                           Id = userGroup.UserGroupID,
                           Name = userGroup.UserGroupName
                       };
        }

        public static explicit operator UserGroup(RedmineTypes::UserGroup userGroup)
        {
            return new UserGroup
                       {
                           UserGroupID = userGroup.Id,
                           UserGroupName = userGroup.Name
                       };
        }
    }
}
